Optimal. Leaf size=126 \[ -\frac {x^{-2 n}}{2 a n}+\frac {b x^{-n}}{a^2 n}+\frac {b \left (b^2-3 a c\right ) \tanh ^{-1}\left (\frac {b+2 c x^n}{\sqrt {b^2-4 a c}}\right )}{a^3 \sqrt {b^2-4 a c} n}+\frac {\left (b^2-a c\right ) \log (x)}{a^3}-\frac {\left (b^2-a c\right ) \log \left (a+b x^n+c x^{2 n}\right )}{2 a^3 n} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.12, antiderivative size = 126, normalized size of antiderivative = 1.00, number of steps
used = 8, number of rules used = 7, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.292, Rules used = {1371, 723, 814,
648, 632, 212, 642} \begin {gather*} \frac {b \left (b^2-3 a c\right ) \tanh ^{-1}\left (\frac {b+2 c x^n}{\sqrt {b^2-4 a c}}\right )}{a^3 n \sqrt {b^2-4 a c}}-\frac {\left (b^2-a c\right ) \log \left (a+b x^n+c x^{2 n}\right )}{2 a^3 n}+\frac {\log (x) \left (b^2-a c\right )}{a^3}+\frac {b x^{-n}}{a^2 n}-\frac {x^{-2 n}}{2 a n} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 212
Rule 632
Rule 642
Rule 648
Rule 723
Rule 814
Rule 1371
Rubi steps
\begin {align*} \int \frac {x^{-1-2 n}}{a+b x^n+c x^{2 n}} \, dx &=\frac {\text {Subst}\left (\int \frac {1}{x^3 \left (a+b x+c x^2\right )} \, dx,x,x^n\right )}{n}\\ &=-\frac {x^{-2 n}}{2 a n}+\frac {\text {Subst}\left (\int \frac {-b-c x}{x^2 \left (a+b x+c x^2\right )} \, dx,x,x^n\right )}{a n}\\ &=-\frac {x^{-2 n}}{2 a n}+\frac {\text {Subst}\left (\int \left (-\frac {b}{a x^2}+\frac {b^2-a c}{a^2 x}+\frac {-b \left (b^2-2 a c\right )-c \left (b^2-a c\right ) x}{a^2 \left (a+b x+c x^2\right )}\right ) \, dx,x,x^n\right )}{a n}\\ &=-\frac {x^{-2 n}}{2 a n}+\frac {b x^{-n}}{a^2 n}+\frac {\left (b^2-a c\right ) \log (x)}{a^3}+\frac {\text {Subst}\left (\int \frac {-b \left (b^2-2 a c\right )-c \left (b^2-a c\right ) x}{a+b x+c x^2} \, dx,x,x^n\right )}{a^3 n}\\ &=-\frac {x^{-2 n}}{2 a n}+\frac {b x^{-n}}{a^2 n}+\frac {\left (b^2-a c\right ) \log (x)}{a^3}-\frac {\left (b \left (b^2-3 a c\right )\right ) \text {Subst}\left (\int \frac {1}{a+b x+c x^2} \, dx,x,x^n\right )}{2 a^3 n}-\frac {\left (b^2-a c\right ) \text {Subst}\left (\int \frac {b+2 c x}{a+b x+c x^2} \, dx,x,x^n\right )}{2 a^3 n}\\ &=-\frac {x^{-2 n}}{2 a n}+\frac {b x^{-n}}{a^2 n}+\frac {\left (b^2-a c\right ) \log (x)}{a^3}-\frac {\left (b^2-a c\right ) \log \left (a+b x^n+c x^{2 n}\right )}{2 a^3 n}+\frac {\left (b \left (b^2-3 a c\right )\right ) \text {Subst}\left (\int \frac {1}{b^2-4 a c-x^2} \, dx,x,b+2 c x^n\right )}{a^3 n}\\ &=-\frac {x^{-2 n}}{2 a n}+\frac {b x^{-n}}{a^2 n}+\frac {b \left (b^2-3 a c\right ) \tanh ^{-1}\left (\frac {b+2 c x^n}{\sqrt {b^2-4 a c}}\right )}{a^3 \sqrt {b^2-4 a c} n}+\frac {\left (b^2-a c\right ) \log (x)}{a^3}-\frac {\left (b^2-a c\right ) \log \left (a+b x^n+c x^{2 n}\right )}{2 a^3 n}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.34, size = 115, normalized size = 0.91 \begin {gather*} \frac {a x^{-2 n} \left (-a+2 b x^n\right )-\frac {2 b \left (b^2-3 a c\right ) \tan ^{-1}\left (\frac {b+2 c x^n}{\sqrt {-b^2+4 a c}}\right )}{\sqrt {-b^2+4 a c}}+2 \left (b^2-a c\right ) \log \left (x^n\right )-\left (b^2-a c\right ) \log \left (a+x^n \left (b+c x^n\right )\right )}{2 a^3 n} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(957\) vs.
\(2(120)=240\).
time = 0.12, size = 958, normalized size = 7.60
method | result | size |
risch | \(\frac {b \,x^{-n}}{a^{2} n}-\frac {x^{-2 n}}{2 a n}-\frac {4 n^{2} \ln \left (x \right ) a^{2} c^{2}}{4 a^{4} c \,n^{2}-a^{3} b^{2} n^{2}}+\frac {5 n^{2} \ln \left (x \right ) a \,b^{2} c}{4 a^{4} c \,n^{2}-a^{3} b^{2} n^{2}}-\frac {n^{2} \ln \left (x \right ) b^{4}}{4 a^{4} c \,n^{2}-a^{3} b^{2} n^{2}}+\frac {2 \ln \left (x^{n}+\frac {3 a \,b^{2} c -b^{4}+\sqrt {-36 a^{3} b^{2} c^{3}+33 a^{2} b^{4} c^{2}-10 a \,b^{6} c +b^{8}}}{2 c b \left (3 a c -b^{2}\right )}\right ) c^{2}}{a \left (4 a c -b^{2}\right ) n}-\frac {5 \ln \left (x^{n}+\frac {3 a \,b^{2} c -b^{4}+\sqrt {-36 a^{3} b^{2} c^{3}+33 a^{2} b^{4} c^{2}-10 a \,b^{6} c +b^{8}}}{2 c b \left (3 a c -b^{2}\right )}\right ) b^{2} c}{2 a^{2} \left (4 a c -b^{2}\right ) n}+\frac {\ln \left (x^{n}+\frac {3 a \,b^{2} c -b^{4}+\sqrt {-36 a^{3} b^{2} c^{3}+33 a^{2} b^{4} c^{2}-10 a \,b^{6} c +b^{8}}}{2 c b \left (3 a c -b^{2}\right )}\right ) b^{4}}{2 a^{3} \left (4 a c -b^{2}\right ) n}+\frac {\ln \left (x^{n}+\frac {3 a \,b^{2} c -b^{4}+\sqrt {-36 a^{3} b^{2} c^{3}+33 a^{2} b^{4} c^{2}-10 a \,b^{6} c +b^{8}}}{2 c b \left (3 a c -b^{2}\right )}\right ) \sqrt {-36 a^{3} b^{2} c^{3}+33 a^{2} b^{4} c^{2}-10 a \,b^{6} c +b^{8}}}{2 a^{3} \left (4 a c -b^{2}\right ) n}+\frac {2 \ln \left (x^{n}-\frac {-3 a \,b^{2} c +b^{4}+\sqrt {-36 a^{3} b^{2} c^{3}+33 a^{2} b^{4} c^{2}-10 a \,b^{6} c +b^{8}}}{2 c b \left (3 a c -b^{2}\right )}\right ) c^{2}}{a \left (4 a c -b^{2}\right ) n}-\frac {5 \ln \left (x^{n}-\frac {-3 a \,b^{2} c +b^{4}+\sqrt {-36 a^{3} b^{2} c^{3}+33 a^{2} b^{4} c^{2}-10 a \,b^{6} c +b^{8}}}{2 c b \left (3 a c -b^{2}\right )}\right ) b^{2} c}{2 a^{2} \left (4 a c -b^{2}\right ) n}+\frac {\ln \left (x^{n}-\frac {-3 a \,b^{2} c +b^{4}+\sqrt {-36 a^{3} b^{2} c^{3}+33 a^{2} b^{4} c^{2}-10 a \,b^{6} c +b^{8}}}{2 c b \left (3 a c -b^{2}\right )}\right ) b^{4}}{2 a^{3} \left (4 a c -b^{2}\right ) n}-\frac {\ln \left (x^{n}-\frac {-3 a \,b^{2} c +b^{4}+\sqrt {-36 a^{3} b^{2} c^{3}+33 a^{2} b^{4} c^{2}-10 a \,b^{6} c +b^{8}}}{2 c b \left (3 a c -b^{2}\right )}\right ) \sqrt {-36 a^{3} b^{2} c^{3}+33 a^{2} b^{4} c^{2}-10 a \,b^{6} c +b^{8}}}{2 a^{3} \left (4 a c -b^{2}\right ) n}\) | \(958\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.39, size = 429, normalized size = 3.40 \begin {gather*} \left [-\frac {a^{2} b^{2} - 4 \, a^{3} c - 2 \, {\left (b^{4} - 5 \, a b^{2} c + 4 \, a^{2} c^{2}\right )} n x^{2 \, n} \log \left (x\right ) + {\left (b^{3} - 3 \, a b c\right )} \sqrt {b^{2} - 4 \, a c} x^{2 \, n} \log \left (\frac {2 \, c^{2} x^{2 \, n} + b^{2} - 2 \, a c + 2 \, {\left (b c - \sqrt {b^{2} - 4 \, a c} c\right )} x^{n} - \sqrt {b^{2} - 4 \, a c} b}{c x^{2 \, n} + b x^{n} + a}\right ) + {\left (b^{4} - 5 \, a b^{2} c + 4 \, a^{2} c^{2}\right )} x^{2 \, n} \log \left (c x^{2 \, n} + b x^{n} + a\right ) - 2 \, {\left (a b^{3} - 4 \, a^{2} b c\right )} x^{n}}{2 \, {\left (a^{3} b^{2} - 4 \, a^{4} c\right )} n x^{2 \, n}}, -\frac {a^{2} b^{2} - 4 \, a^{3} c - 2 \, {\left (b^{4} - 5 \, a b^{2} c + 4 \, a^{2} c^{2}\right )} n x^{2 \, n} \log \left (x\right ) - 2 \, {\left (b^{3} - 3 \, a b c\right )} \sqrt {-b^{2} + 4 \, a c} x^{2 \, n} \arctan \left (-\frac {2 \, \sqrt {-b^{2} + 4 \, a c} c x^{n} + \sqrt {-b^{2} + 4 \, a c} b}{b^{2} - 4 \, a c}\right ) + {\left (b^{4} - 5 \, a b^{2} c + 4 \, a^{2} c^{2}\right )} x^{2 \, n} \log \left (c x^{2 \, n} + b x^{n} + a\right ) - 2 \, {\left (a b^{3} - 4 \, a^{2} b c\right )} x^{n}}{2 \, {\left (a^{3} b^{2} - 4 \, a^{4} c\right )} n x^{2 \, n}}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {1}{x^{2\,n+1}\,\left (a+b\,x^n+c\,x^{2\,n}\right )} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________